package com.mm.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.mm.plugin.logging.enums.BusinessType;
import com.mm.plugin.logging.enums.LoggingType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * <p>
 * 日志表
 * </p>
 *
 * @author wdx
 * @since 2021-03-04
 */
@Data
@TableName("mm_log")
@ApiModel(value="MmLog对象", description="日志表")
public class MmLog extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "标题")
    @TableId(value = "id")
    private Integer id;

    @ApiModelProperty(value = "标题")
    @TableField("title")
    private String title;

    @ApiModelProperty(value = "请求方式")
    @TableField("method")
    private String method;

    @ApiModelProperty(value = "业务类型")
    @TableField("business_type")
    private BusinessType businessType;

    @ApiModelProperty(value = "请求方法")
    @TableField("request_method")
    private RequestMethod requestMethod;

    @ApiModelProperty(value = "操作人")
    @TableField("operate_name")
    private String operateName;

    @ApiModelProperty(value = "操作路径")
    @TableField("operate_url")
    private String operateUrl;

    @ApiModelProperty(value = "操作地址")
    @TableField("operate_address")
    private String operateAddress;

    @ApiModelProperty(value = "请求参数")
    @TableField("request_param")
    private String requestParam;

    @ApiModelProperty(value = "相应消息体")
    @TableField("response_body")
    private String responseBody;

    @ApiModelProperty(value = "是否成功")
    @TableField("success")
    private Boolean success;

    @ApiModelProperty(value = "异常信息")
    @TableField("error_msg")
    private String errorMsg;

    @ApiModelProperty(value = "描述")
    @TableField("description")
    private String description;

    @ApiModelProperty(value = "请求消息体")
    @TableField("request_body")
    private String requestBody;

    @ApiModelProperty(value = "使用浏览器")
    @TableField("browser")
    private String browser;

    @ApiModelProperty(value = "操作系统")
    @TableField("system_os")
    private String systemOs;

    @ApiModelProperty(value = "日志类型，登录日志，操作日志")
    @TableField("logging_type")
    private LoggingType loggingType;


    public static final String TITLE = "title";

    public static final String METHOD = "method";

    public static final String BUSINESS_TYPE = "business_type";

    public static final String REQUEST_METHOD = "request_method";

    public static final String OPERATE_NAME = "operate_name";

    public static final String OPERATE_URL = "operate_url";

    public static final String OPERATE_ADDRESS = "operate_address";

    public static final String REQUEST_PARAM = "request_param";

    public static final String RESPONSE_BODY = "response_body";

    public static final String SUCCESS = "success";

    public static final String ERROR_MSG = "error_msg";

    public static final String DESCRIPTION = "description";

    public static final String REQUEST_BODY = "request_body";

    public static final String BROWSER = "browser";

    public static final String SYSTEM_OS = "system_os";

    public static final String LOGGING_TYPE = "logging_type";

}
